#include <alibabacloud/oss/OssClient.h>
#include <string.h>

using namespace AlibabaCloud::OSS;
using std::string;
using std::cout;
using std::cerr;

struct OSSinfo{
    string EndPoint = "oss-cn-wuhan-lr.aliyuncs.com";
    string AccessKeyID = "";
    string AccessKeySecret = "";
    string Bucket = "";
};

int main(){
    InitializeSdk();
    OSSinfo info;
    ClientConfiguration conf;
    OssClient client(info.EndPoint, info.AccessKeyID, info.AccessKeySecret, conf);

    auto outcome = client.PutObject(info.Bucket,"testdir/test.cpp", "http_task_callback.cpp");
    if(outcome.isSuccess())cout << "put object success!\n";
    else cerr << "put object failed! \n" << "failed message = " << outcome.error().Message() << "\n";
    
    ShutdownSdk();
    return 0;
}